<link type="text/css" href="/admins/js/pagerView/pager-view.css" rel="stylesheet" />
<link type="text/css" href="/admins/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/admins/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="/admins/js/jquery/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="/admins/js/pagerView/pager-view.js"></script>
<script type="text/javascript">
    $(function(){
        $.datepicker.setDefaults( $.datepicker.regional[ "zh-CN" ] );
        $( "#form1 #sel #starttime" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
        $( "#form1 #sel #endtime" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
    });
</script>
<style>
      #addobject{
            width: 500px;
            height: 400px;
            position: absolute;
            top: 50%;
            left: 50%;
            
            margin-left:-400px;
            background-color: #fff;
            display: none;            
            text-align: center;
            border: 2px solid #000;
            filter:alpha(opactiy=20);
            -moz-opacity:1 ;
            opacity:1;
      }
    input{
            background-color: #FF6;
      }
</style>

<form action="/admini/domainobject/index/"  method="get" style="margin:0px" id="form1">
    <div style=" border:1px solid #DDDDDD; padding:2px; margin:2px;line-height: 36px;" id='sel'> 
          <label for="quick">&nbsp;&nbsp;快速搜索：</label><input type="text" id="name" name="objectId" value="<?php echo $this->objectId; ?>" />
        <input type="submit" id="queryButton" name="queryButton" value="查询"/>
    </div>
</form>

<div class="dataTable">
    <table>         
    <tfoot>
      <tr><td colspan="14"><input class="button" id="add-button" type="button" value="添加到待办事项" /><input class="button" id="del-button" type="button" value="删除" /></td></tr>
    </tfoot>
        <tr>
            <th class="w1" width="4px" style="background-color: white;"></th>
            <th class="w2" width="10% " nowrap>事项类型</th>
            <th class="w3" width="10%" nowrap>事项id</th>
            <th class="w4" width="12%" nowrap>创建时间</th>
            <th class="w5" width="15%" nowrap>事项状态</th>
            <th class="w6" width="17%" nowrap>创建人</th>
            <th class="w7" width="17%" nowrap>事项操作人</th>
            <th class="w8" width="20%" nowrap>事项内容</th>
        </tr>  

        <?php
        if ($this->objlist) {
            foreach ($this->objlist as $Item) {
                ?>
                <tr>
               
                    <td class="w1" width="5px" align="center"><input type="checkbox" value="<?php echo $Item->id; ?>" class="checkbox-del" name='checkbox'  /></td>     
                    <td class="w2" align="center"><a href="/admini/domainobject/examin/id/<?php echo $Item->id;?>"><?php echo $Item->objectType; ?></a></td>
                    <td class="w3" align="center"><a href="/admini/domainobject/examin/id/<?php echo $Item->id;?>"><?php echo $Item->objectId; ?></a></td>               
                    <td class="w4" align="center"><?php echo $Item->dateCreated; ?></td>
                    <td class="w5" align="center"><?php echo $Item->status; ?></td>
                    <td class="w6" align="center"><?php echo $Item->creator; ?></td>
                    <td class="w7" align="center"><?php echo $Item->operator; ?></td>
                     <td class="w7" align="center"><?php echo $Item->content; ?></td>
                </tr>
        <?php
    }
}
?>
    </table>
</div>
<div id="flowall" style="position: absolute;top: 0px;left: 0px;width:100%;height:1000px;background-color: #eee;filter:alpha(opactiy=20); -moz-opacity:0.5 ;opacity:0.4; display: none;">
</div>
      <div id="addobject">
      <div  id="closeobj"style="width:40px;height:20px;float: right;cursor:pointer;background-color: white;border-bottom: 2px solid #000;border-left: 2px solid #000;">
            关闭
      </div>
      <form name="todoobject" method="post"  id="formstore" action="/admini/domainobject/add/" style="padding-top:20px; padding-left: 60px;" >
            <table width="300px" height="300px">
                  <tr> 
                        <td><h3> 请输入事项类型</h3></td>
                        <td valign="left"><input name="addobjectType" required="" type="text"/> </td>
                  </tr>
                  <tr> 
                        <td valign="right"><h3> 请输入事项ID </h3>
                        </td>
                        <td valign="left"><input name="addobjectId" required="" type="text"/> </td>
                  </tr>
                  <tr> 
                        <td valign="right"><h3> 请选择创建者</h3></td>
                        <td valign="left"><select name="addcreator" type="text"/>
                                              <option value="1" selected="" width="50px">创建A</option>
                                            </select>
                              </td>
                  </tr>
                  <tr>  
                        <td valign="right"><h3> 请选择操作者 </h3></td>
                        <td valign="left"><select name="addoprator" type="text"/>
                                                <option value="1" selected="">作者A</option>
                                          </select>
                        </td>
                  </tr>
                  <tr> 
                        <td valign="right"> <h3> 请输入事项内容</h3></td>
                        <td valign="left"><textarea name="addcontent" required="" type="text" cols="20" rows="3"></textarea></td>
                  </tr>
                  <tr>
                        <td colspan="2"><input type="submit" name="submit1" value="确定"/></td>
                  </tr>
            </table>
      </form>
</div>

<div class="toolbar">
    <?php echo $this->partial('paging.phtml', array("pages" => $this->userall,"pamas"=>"name=".$this->name)); ?>
</div>
<?php
if(isset($this->message) && $this->message!=""){
    echo '<script language="javascript" type="text/javascript">alert("'. $this->message .'")</script>';
}

?>
<script language="javascript">
       $(function() {
            //必填项的控制
            $('form').validate();
    $('#add-button').click(function(){
          $('#flowall').show();
        $('#addobject').show();
        $("input[name='addobjectType']").focus();
    });
    $('#closeobj').click(function(){
           $('#flowall').hide();
        $('#addobject').hide();
    });
    $('#del-button').click(function(){
        var idlist = "";
        $('input[name="checkbox"]:checked').each(function(){    
		idlist += $(this).val()+",";
	});
        if(idlist == ''){
            alert("请选择用户");
            return false;
        }else{
            if(confirm("您确定删除该用户？","提示信息")){     
                $.ajax({
                    type: 'POST',
                    url: "/admini/autotask/deljob/idlist/"+idlist,
                    success: function(data) {
                        if(data == 1){
                            alert("删除成功！");
                            location.href='/admini/autotask/index/';
                        }
                    }
                });
            }
        }
    });
     });
</script>


